<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<script>
	function goInsert() {
		var form = document.getElementById("tagForm");
		form.action = '/admin/koreaflower/tag/insert.html';
		form.submit();
	}
	function goUpdate() {
		var form = document.getElementById("tagForm");
		form.action = '/admin/koreaflower/tag/update.html';
		form.submit();
	}
	function goDelete() {
		var form = document.getElementById("tagForm");
		form.action = '/admin/koreaflower/tag/delete.html';
		form.submit();
	}
</script>
<form id="tagForm" name="tagForm" method="post">
<c:if test="${not empty tag}">
<input type="hidden" name="id" value="${tag.id}"/>
</c:if>
<table>
	<tr>
		<th>name</th>
		<td><input type="text" name="name" value="${tag.name}"/></td>
	</tr>	
	<tr>
		<th>order</th>
		<td><input type="text" name="orderNo" value="${tag.orderNo}"/></td>
	</tr>	
	<tr>
		<th>eventYN</th>
		<td><input type="text" name="eventYN" value="${tag.eventYN}"/></td>
	</tr>	
</table>

<div>
	<c:if test="${empty tag}"><input type="button" value="저장" onclick="goInsert()"/></c:if>
	<c:if test="${not empty tag}"><input type="button" value="수정" onclick="goUpdate()"/></c:if>
	<c:if test="${not empty tag}"><input type="button" value="삭제" onclick="goDelete()"/></c:if>
</div>
</form>
